'use strict';

angular.module('com.dcos.app').factory('WorkFlowService', function ($http) {
	return {
		getlist: function (project_id) {
	      return $http({
	        method: 'POST',
	        url:'/api/workflow/listjob',
	        data:JSON.stringify({project_id:project_id}),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
//			return $http.get("../../controllers/workflow/joblist.json");
	    },
		delete: function (p_id) {
	      return $http({
	        method: 'POST',
	        url:'v1/api/deletejob',
	        data:JSON.stringify({p_id:p_id}),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
	    },
		build: function (p_id) {
	      return $http({
	        method: 'POST',
	        url:'/v1/api/buildjob',
	        data:JSON.stringify({p_id:p_id}),
	        headers: {'Content-type': 'application/json','Accept': 'application/json'}
	      })
	    }
	}
});
